package com.zjf.controller;

import com.zjf.common.Result;
import com.zjf.entity.Food;
import com.zjf.service.IFoodService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;



@RestController
@RequestMapping("/food")
@CrossOrigin
public class FoodController {
    @Resource
    private IFoodService foodService;
    @GetMapping("/list")
    public Result<List<Food>> listFoodByBusinessId(@RequestParam("bId") Integer bId){

        List<Food> foodList= foodService.listFoodByBusinessId(bId);
        return Result.success(foodList,"查询成功");

    }
}
